Skip to content

[#292] TodoEditorView에서 content의 상단 부분을 수정하려고 시도하면 키보드가 내려간 상태에서 누르면 무조건 아래쪽으로 내려가는 이슈를 해결한다#298

Merged
opficdev merged 7 commits intodevelopfrom
fix/#292-TodoEditorView-Auto-Scrolled
Mar 18, 2026
Merged

Conversation

@opficdev
Copy link
Owner

@opficdev opficdev commented Mar 18, 2026

@opficdev opficdev self-assigned this Mar 18, 2026
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

이 Pull Request는 TodoEditorView에서 콘텐츠 편집 시 키보드 활성화 상태에서 발생하는 스크롤 문제를 해결하는 데 중점을 둡니다. 이를 위해 SwiftUI의 기본 TextEditor 대신, UITextView를 기반으로 하는 새로운 UIKitTextEditor 컴포넌트를 도입했습니다. 이 커스텀 컴포넌트는 동적 높이 조절, 플레이스홀더 지원, 그리고 특히 키보드 등장 시 상위 스크롤 뷰의 오프셋을 보존하고 복원하는 기능을 포함하여, 편집 경험을 크게 개선합니다. 또한, 미리보기 전환 로직을 리팩토링하여 포커스 관리를 더욱 견고하게 만들었습니다.

Highlights

  • 새로운 UIKitTextEditor 컴포넌트 도입: 기존 SwiftUI의 TextEditor가 아닌, UITextView를 래핑한 커스텀 UIKitTextEditor 뷰를 추가하여 텍스트 입력에 대한 더 세밀한 제어를 가능하게 했습니다.
  • 스크롤 문제 해결: TodoEditorView에서 키보드가 활성화된 상태에서 콘텐츠 상단을 편집할 때 발생하던 원치 않는 스크롤 문제를, UIKitTextEditor의 스크롤 오프셋 유지 로직을 통해 해결했습니다.
  • 동적 높이 및 플레이스홀더 지원: 새로운 UIKitTextEditor는 콘텐츠에 따라 동적으로 높이를 조절하며, 플레이스홀더 텍스트를 지원하여 사용자 경험을 개선합니다.
  • 미리보기 전환 로직 개선: TodoEditorView의 미리보기 전환 로직을 transitionToPreview 메서드로 분리하고, 포커스 해제 및 탭 전환을 비동기적으로 처리하여 안정성을 높였습니다.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

안녕하세요. TodoEditorView의 스크롤 이슈를 해결하기 위해 커스텀 UIKitTextEditor 컴포넌트를 도입하신 변경 사항 잘 보았습니다. 이와 관련하여 새로 추가된 컴포넌트의 안정성을 높이고, 수정 과정에서 발생한 국제화 문제를 해결하기 위한 몇 가지 제안 사항을 리뷰에 남겼습니다. 확인 부탁드립니다.

Comment on lines +180 to +183
DispatchQueue.main.asyncAfter(deadline: .now() + 0.1) { [weak self] in
self?.restoreAncestorScrollOffsetIfNeeded()
self?.preservedContentOffset = nil
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

DispatchQueue.main.asyncAfter를 사용하여 0.1초의 고정된 지연 시간을 주는 것은 불안정할 수 있습니다. 디바이스의 성능이나 시스템 상태에 따라 이 시간이 충분하지 않아 버그가 발생할 수 있습니다.
더 안정적인 방법으로 UIResponder.keyboardWillShowNotification 또는 UIResponder.keyboardDidShowNotification과 같은 키보드 노티피케이션을 구독하여 키보드 애니메이션과 동기화하거나, UIScrollViewcontentOffset을 KVO로 관찰하여 변경에 대응하는 것을 고려해 보시는 것이 좋겠습니다.

),
prompt: Text("설명(선택)").foregroundColor(Color.secondary),
axis: .vertical
placeholder: "설명(선택)"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

placeholder에 문자열을 직접 하드코딩하면 국제화가 지원되지 않는 문제가 있습니다. 기존 TextFieldprompt에서는 Text 뷰를 통해 자동적으로 지역화가 이루어졌습니다.
Localizable.xcstrings 파일에 "설명(선택)" 키를 다시 추가하고, 이 곳에서는 String(localized: "설명(선택)") 또는 NSLocalizedString를 사용하여 지역화된 문자열을 사용하도록 수정하는 것이 좋겠습니다.

Suggested change
placeholder: "설명(선택)"
placeholder: String(localized: "설명(선택)")

@opficdev opficdev merged commit a658eeb into develop Mar 18, 2026
2 checks passed
@opficdev opficdev deleted the fix/#292-TodoEditorView-Auto-Scrolled branch March 18, 2026 08:48
@opficdev opficdev restored the fix/#292-TodoEditorView-Auto-Scrolled branch March 18, 2026 09:14
@opficdev opficdev deleted the fix/#292-TodoEditorView-Auto-Scrolled branch March 18, 2026 09:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant